function GamePayline(stage, name) {
	this.name = name;

	this.animation = new createjs.BitmapAnimation(this.spriteSheet);

	switch (name) {
		case 'left_4':
			this.animation.y = 78;
			break;
		case 'left_2':
			this.animation.y = 121;
			break;
		case 'left_6':
			this.animation.y = 164;
			break;
		case 'left_8':
			this.animation.y = 207;
			break;
		case 'left_1':
			this.animation.y = 250;
			break;
		case 'left_9':
			this.animation.y = 293;
			break;
		case 'left_7':
			this.animation.y = 336;
			break;
		case 'left_3':
			this.animation.y = 379;
			break;
		case 'left_5':
			this.animation.y = 422;
			break;


		case 'right_10':
			this.animation.x = 745;
			this.animation.y = 78;
			break;
		case 'right_12':
			this.animation.x = 745;
			this.animation.y = 121;
			break;
		case 'right_14':
			this.animation.x = 745;
			this.animation.y = 164;
			break;
		case 'right_8':
			this.animation.x = 745;
			this.animation.y = 207;
			break;
		case 'right_1':
			this.animation.x = 745;
			this.animation.y = 250;
			break;
		case 'right_9':
			this.animation.x = 745;
			this.animation.y = 293;
			break;
		case 'right_15':
			this.animation.x = 745;
			this.animation.y = 336;
			break;
		case 'right_11':
			this.animation.x = 745;
			this.animation.y = 379;
			break;
		case 'right_13':
			this.animation.x = 745;
			this.animation.y = 422;
			break;
	}

	this.stop();
	stage.addChild(this.animation);
}

var frequency = 4;
var framesLeft = [
	[+0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +0, -1],
	[-1, +4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +4, -1, -1],
	[-1, -1, +8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +8, -1, -1, -1],
	[-1, -1, -1, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, -1, -1, -1, -1],
	[-1, -1, -1, -1, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, 28, -1, -1, -1, 28, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, 32, -1, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1]
];

var framesRight = [
	[+1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +1, -1],
	[-1, +5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +5, -1, -1],
	[-1, -1, +9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, +9, -1, -1, -1],
	[-1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1],
	[-1, -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, 21, -1, -1, -1, -1, -1, -1, -1, 21, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, 25, -1, -1, -1, -1, -1, 25, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, 29, -1, -1, -1, -1, -1, -1, -1, -1],
	[-1, -1, -1, -1, -1, -1, -1, -1, 33, -1, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1]
];

GamePayline.prototype.spriteSheet = new createjs.SpriteSheet({
	animations:{
		idle:[-1, -1],
		play_left_4:{
			frames:framesLeft[0],
			frequency:frequency
		},
		play_left_2:{
			frames:framesLeft[1],
			frequency:frequency
		},
		play_left_6:{
			frames:framesLeft[2],
			frequency:frequency
		},
		play_left_8:{
			frames:framesLeft[3],
			frequency:frequency
		},
		play_left_1:{
			frames:framesLeft[4],
			frequency:frequency
		},
		play_left_9:{
			frames:framesLeft[5],
			frequency:frequency
		},
		play_left_7:{
			frames:framesLeft[6],
			frequency:frequency
		},
		play_left_3:{
			frames:framesLeft[7],
			frequency:frequency
		},
		play_left_5:{
			frames:framesLeft[8],
			frequency:frequency
		},

		play_right_10:{
			frames:framesRight[0],
			frequency:frequency
		},
		play_right_12:{
			frames:framesRight[1],
			frequency:frequency
		},
		play_right_14:{
			frames:framesRight[2],
			frequency:frequency
		},
		play_right_8:{
			frames:framesRight[3],
			frequency:frequency
		},
		play_right_1:{
			frames:framesRight[4],
			frequency:frequency
		},
		play_right_9:{
			frames:framesRight[5],
			frequency:frequency
		},
		play_right_15:{
			frames:framesRight[6],
			frequency:frequency
		},
		play_right_11:{
			frames:framesRight[7],
			frequency:frequency
		},
		play_right_13:{
			frames:framesRight[8],
			frequency:frequency
		}
	},
	images:['images/game_ims_paylines.jpg'],
	frames:{
		width:55.5,
		height:43
	}
});

GamePayline.prototype.play = function () {
	this.animation.gotoAndPlay('play_' + this.name);
};

GamePayline.prototype.stop = function () {
	this.animation.gotoAndPlay('idle');
};